# 写入并读取古诗《静夜思》

# 写入古诗到文本文件
poem = """       静夜思
        唐·李白
床前明月光，疑是地上霜。
举头望明月，低头思故乡。"""

with open("静夜思.txt", "w", encoding="utf-8") as f:
    f.write(poem)

# 读取并输出古诗内容
with open("静夜思.txt", "r", encoding="utf-8") as f:
    content = f.read()
print(content)
